home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!ts1-10
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++
- Subject: Re: C code in a C++ app
- Date: Sun, 03 Mar 96 06:15:22 GMT
- Organization: MiddleWorld SoftWare
- Message-ID: <4hbddg$899@sam.inforamp.net>
- References: <4h7t43$6as@frodo.smartlink.net>
- NNTP-Posting-Host: ts1-10.tor.inforamp.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <4h7t43$6as@frodo.smartlink.net>,
- thomash@warp10.smartlink.net (Thomas Hackbarth) wrote:
- >I'm working on porting a C app. from MAC to the PC. The app is basicly C
- >and I'm replacing the UI for the PC side. I need to compile and link C
- >code into my MFC application. I get errors basicly saying I can't compile
- >C code with CPP, OK I renamed the file to CPP then I need to add #include
- ><stdafx.h>. I would rather not change any of the C files at all. They
- >need to stay multiplatform as well as multi-compiler.
- >
- >Does anyone know how to build a MCF app with C code, with out changing
- >the C code.
-
- Change your function headers to
- extern "C" void _export PayrollProcess(PAYROLLPROCESS * B)
- from
- void _export PayrollProcess(PAYROLLPROCESS * B)
-
- This tells the compiler that your C++ code is really C code.
-
- Agrivar
-